import UserLoginPage from '@/views/user/UserLoginPage.vue'
import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [{
    path: '/',
    name:'home',
    component: () => import('@/views/HomePage.vue')
  },
  {
    path: '/user/login',
    name:'用户登录',
    component: UserLoginPage
  },
  {
    path: '/user/register',
    name:'用户注册',
    component: () => import('@/views/user/UserRegisterPage.vue')
  },
  {
    path: '/admin/userManage',
    name:'用户管理',
    component: () => import('@/views/admin/UserManagePage.vue')
  },
    {
    path: '/admin/pictureManage',
    name:'图片管理',
    component: () => import('@/views/admin/PictureManagerPage.vue')
  },
   {
    path: '/admin/spaceManage',
    name:'空间管理',
    component: () => import('@/views/admin/SpaceManagerPage.vue')
  },
  {
    path: '/spaceUserManger/:id',
    name:'空间成员管理',
    component: () => import('@/views/admin/SpaceUserManagerPage.vue'),
    props: true
  },
  {
    path:'/user/center',
    name:'用户中心',
    component: () => import('@/views/user/UserCenterPage.vue')
  },
  {
    path:'/add_picture',
    name:'创建图片',
    component: () => import('@/views/AddPicturePage.vue')
  },
    {
    path:'/picture/:id',
    name:'图片详情',
    component: () => import('@/views/PictureDetailPage.vue'),
    props: true,
  },
   {
    path:'/add_picture/batch',
    name:'批量创建图片',
    component: () => import('@/views/AddPictureBatchPage.vue'),
    props: true,
  },
    {
    path:'/add_space',
    name:'创建空间',
    component: () => import('@/views/AddSpacePage.vue')
  },
   {
    path:'/my_space',
    name:'我的空间',
    component: () => import('@/views/MySpacePage.vue')
  },
    {
    path:'/space/:id',
    name:'空间详情',
    component: () => import('@/views/SpaceDetailPage.vue'),
    props: true,
  },
   {
    path:'/space_analyze',
    name:'空间分析',
    component: () => import('@/views/SpaceAnalyzePage.vue'),
    props: true,
  },
    {
    path:'/search_picture',
    name:'图片搜索',
    component: () => import('@/views/SearchPicturePage.vue'),
    props: true,
  },
],
})

export default router
